<?php
namespace app\index\controller;

use app\admin\model\ShopIcon;
use app\admin\model\ShopLunbo;
use think\Controller;
use think\Db;

class Index extends Base
{
    public function index(){
        $rotate=ShopLunbo::order('sort desc')->select()->toArray();
        $icon = ShopIcon::order('icon_sort desc')->select()->toArray();
        $this->assign('rotate',$rotate);
        $this->assign('icon',$icon);

        $this->assign('pageType','index');
        return $this->fetch();
    }
    public function imgtext(){
        $result=Db::name('imgtext')->where('id',input('get.id'))->find();
        $this->assign('imgtextData',$result);
        if($result['t_url']!=null){
            $url=$result['t_url'];
            echo "<meta charset='utf-8' /><script>window.location.href='$url';</script>";
        }
        return $this->fetch();
    }

}
